const state = {
  selectedItem: {
    type: '',
    data: null
  },
  graph: null,
  canExit: true
}

const mutations = {
  selectedItem: (state, { type, data }) => {
    state.selectedItem.type = type
    state.selectedItem.data = data
  },
  graph: (state, data) => { state.graph = data.graph },
  setExitState: (state, data) => {
    state.canExit = data
  }
}

export default {
  namespaced: true,
  state,
  mutations
}
